<template>
  <a-table :dataSource="dataSource" :columns="columns" />
</template>



<script>
import { ipcApiRoute } from '@/api/main';
import { ipc } from '@/utils/ipcRenderer';

export default {
  data() {
    return {
      dataSource: [
      ],

      columns: [
        {
          title: '名称',
          dataIndex: 'name',
          key: 'name',
        },
        {
          title: 'url',
          dataIndex: 'url',
          key: 'url',
        },
        {
          title: '用户名',
          dataIndex: 'username',
          key: 'username',
        },
        {
          title: '密码',
          dataIndex: 'passwrod',
          key: 'passwrod',
        },
      ]
    };
  },
  created(){
      this.getDataSource()
  },
  methods: {
     getDataSource(){
       ipc.invoke(ipcApiRoute.getDataSource, {}).then(r => {
         console.log('##########'+r)
         if (r.code != 0) {
           this.$message.error(r.msg);
         }
       })
     }
  }
};
</script>
<style lang="less" scoped>

</style>
